package com.anjie.powerproject.service.impl;

import com.anjie.powerproject.entity.StrategyTemp;
import com.anjie.powerproject.repository.StrategyTempRepository;
import com.anjie.powerproject.service.StrategyTempService;
import com.anjie.powerproject.strategy.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class StrategyTempServiceImpl implements StrategyTempService {

    @Autowired
    StrategyTempRepository strategyTempRepository;

    @Override
    public List<StrategyTemp> getStrategyTempsByDateAndType(Integer type, Date time) {
        String timeStr = DateUtils.ymdFormat.format(time);
        return strategyTempRepository.findStrategyTempsByTypeAndDate(type, timeStr);
    }
}
